<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理-登陆</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="__STATIC__/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <!--[if lt IE 9]>
    <script src=""></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        html, body {width: 100%;height: 100%;overflow: hidden}
        body {background: #FFFFFF;}
        body:after {content:'';background-repeat:no-repeat;background-size:cover;-webkit-filter:blur(3px);-moz-filter:blur(3px);-o-filter:blur(3px);-ms-filter:blur(3px);filter:blur(3px);position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;}
        .layui-container {width: 100%;height: 100%;overflow: hidden}
        .admin-login-background {width:600px;height:300px;position:absolute;left:50%;top:40%;margin-left:-180px;margin-top:-100px;}
        .logo-title {text-align:center;letter-spacing:2px;padding:14px 0;}
        .logo-title h1 {color:#1E9FFF;font-size:25px;font-weight:bold;}
        .login-form {background-color:#fff;border:1px solid #fff;border-radius:3px;padding:14px 20px;box-shadow:0 0 8px #eeeeee;}
        .login-form .layui-form-item {position:relative;}
        .login-form .layui-form-item label {position:absolute;left:1px;top:1px;width:38px;line-height:36px;text-align:center;color:#d2d2d2;}
        .login-form .layui-form-item input {padding-left:36px;}
        .captcha {width:60%;display:inline-block;}
        .captcha-img {display:inline-block;width:34%;float:right;}
        .captcha-img img {height:34px;border:1px solid #e6e6e6;height:36px;width:100%;}
        .layui-input-block {display: flex;justify-content: space-between;width: 100%;
            text-align: center;margin-left: 0;}
        .layui-rr {width: 50%;}
        .layui-form-radio{width: 45%;}


        #bgBody {
            background-image: url(../../../static/img/pp.png);

            background-size: cover;
            background-repeat: no-repeat;
            position: fixed;
            left: 0px;
            top: 0px
        }
    </style>
</head>
<style>
    .layui-inline{
        width: auto;
        position: fixed;
        top: 90px;
        left: 905px;
        z-index: 10;
    }
    #xxx{
        position: fixed;
        top: 60px;
        left: 905px;
    }
</style>
<body>
<div class="layui-container" id="bgBody">
    <div class="admin-login-background">
        <div class="layui-form login-form">


            <div class="layui-input-block" id="IsPurchased">
                <input class="layui-rr" type="radio" id="s" name="addtest" value="1" title="学生登录" lay-filter="aaa"/>
                <input class="layui-rr" type="radio" id="f" name="addtest" value="0" title="教师登录" lay-filter="aaa"/>
                <input class="layui-rr" type="radio" id="p" name="addtest" value="2" title="院系登录" lay-filter="aaa"/>
                <input class="layui-rr" type="radio" checked="checked" id="o" name="addtest" value="3" title="管理人员登录" lay-filter="aaa"/>
            </div>

            <div class="layui-form-item">
                <label class="layui-icon layui-icon-username" ></label>
                <input type="text" name="educationalId" lay-verify="required|account" placeholder="请输入账号" autocomplete="off" class="layui-input" >
            </div>
            <div class="layui-form-item">
                <label class="layui-icon layui-icon-username" ></label>
                <input type="text" name="userId" lay-verify="required|account" placeholder="请输入身份证" autocomplete="off" class="layui-input" >
            </div>
            <div class="layui-form-item">
                <label class="layui-icon layui-icon-username" ></label>
                <input type="text" name="educationalName" lay-verify="required|account" placeholder="请输入姓名" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-item">
                <button id="kk" class="layui-btn layui-btn layui-btn-normal layui-btn-fluid" lay-submit="">登 入</button>
            </div>

        </div>
    </div>

    <p id="xxx">学年选择</p>
    <div class="layui-inline"> <!-- 注意：这一层元素并不是必须的 -->
        <input type="text8" class="layui-input" id="test8" name="xxxxx">
    </div>

</div>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<script src="__STATIC__/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="__STATIC__/layuimini/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script>

    layui.use('laydate', function(){
        var laydate = layui.laydate;

        laydate.render({
            elem: '#test8'
            ,type: 'month'
            ,range: true
            ,done: function(value){
            }
        });
    });

    layui.use('form', function () {
        var form = layui.form;

        form.on('radio(aaa)', function (data) {
            if ($('#IsPurchased input[name="addtest"]:checked ').val() == "1") {

                window.location.href = 'http://cmf.yeeyeeyjy.top/lunwen/login.html';
            }
            else if($('#IsPurchased input[name="addtest"]:checked ').val() == "0") {
                window.location.href = 'http://cmf.yeeyeeyjy.top/lunwen/teacher_login.html';
            }
            else if($('#IsPurchased input[name="addtest"]:checked ').val() == "3") {
                window.location.href = 'http://cmf.yeeyeeyjy.top/lunwen/educational_login.html';
            }
            else {
                window.location.href = 'http://cmf.yeeyeeyjy.top/lunwen/department_login.html';
            }
            form.render();
        });
    });
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer;

        // 登录过期的时候，跳出ifram框架
        if (top.location != self.location) top.location = self.location;

        /* // 粒子线条背景
         $(document).ready(function(){
             $('.layui-container').particleground({
                 dotColor:'#7ec7fd',
                 lineColor:'#7ec7fd'
             });
         });*/

        // 进行登录操作
        /* form.on('submit(login)', function (data) {
             data = data.field;
             if (data.departmentId == '') {
                 layer.msg('用户编号不能为空');
                 return false;
             }
             if (data.userId == '') {
                 layer.msg('身份证编号不能为空');
                 return false;
             }
             if (data.departmentName == '') {
                 layer.msg('名字不能为空');
                 return false;
             }
             layer.msg('登录成功', function () {
             });
             return false;
         });*/
        // 登录按钮监听
        $("button#kk").click(function() {
            var year = $("input[name=xxxxx]").val();
            var stuID = $("input[name=educationalId]").val();   //获取输入框的数据
            var userId = $("input[name=userId]").val();
            var educationalName = $("input[name=educationalName]").val();
            //var idcard = $("input#userId").val();
            //var stuname = $("input#name").val();
            $.ajax({
                //这里采用了 ajax 的请求其他页面，你的登录页是 lunwen/login控制器/index 方法渲染页面
                //然后js获取输入框的数据，采用下面post的代码向 lunwen/login控制器/login_check 方法提交数据
                type: "post",
                async:true,
                url: "{:url('http://cmf.yeeyeeyjy.top/lunwen/check_login/educationalLogin')}",
                data: {
                    yearConfig:year,
                    educationalId:stuID,
                    userId:userId,
                    educationalName:educationalName
                },
                //检测请求成功后返回的数据，登录成功/账号密码错误等等
                success: function (result) {
                    var result_code = JSON.stringify(result.code);  //JSON转换成字符串
                    var result_msg = JSON.stringify(result.msg);
                    if (result_code !== '1') {
                        // 我在 login_check 方法定义非1为登录失败
                        layer.msg(result_msg);  //小弹框提示登录失败
                    }else {
                        // 登录成功后跳转的后台页面，要自己补全
                        layer.msg(result_msg);  //小弹框提示登录成功，你可以改成跳转到后台页
                        window.location.href = 'http://cmf.yeeyeeyjy.top/lunwen/educational_login/login';
                    }
                },
                error: function (result) {
                    //这里是请求失败的处理，可以给调试使用或者用户网络问题的时候提示
                    parent.layer.msg("服务器接口异常，请稍后再试");
                    //console.log(result);
                }
            });
        });

    });

</script>
</body>
</html>